package me.wangshier.leetcode.medium;

/**
 * 14. 数组元素之和最小化
 *
 * @Author: tongqianwen
 * @Date: 2025/3/7
 */
public class MinimizeArraySum {
    public static int solution(int n, int k) {
        return n * (n + 1) / 2 * k;
    }

    public static void main(String[] args) {
        System.out.println(solution(3, 1) == 6);
        System.out.println(solution(2, 2) == 6);
        System.out.println(solution(4, 3) == 30);
    }
}
